//
//  UIBarbutton+Extension.swift
//  新浪微博
//
//  Created by linlin on 15/11/26.
//  Copyright © 2015年 jilin. All rights reserved.
//

import UIKit




extension UIBarButtonItem {
    
    convenience init(imageName: String) {
        let button = UIButton()
        
        button.setBackgroundImage(UIImage(named: imageName), forState: UIControlState.Normal)
        button.setBackgroundImage(UIImage(named: imageName + "_highlighted"), forState: UIControlState.Highlighted)
        
        button.sizeToFit()
        
        self.init(customView: button)
        
    }
    
    
}